<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.a{
				background-color: aqua;
				width: 50px;
				height: 50px;
			}
			button{
				width: 40px;
				height: 40px;
			}
		</style>
	</head>
	<body>
		<div id="main" class="a"></div>
		<button onclick="change('1000px')" ondblclick="change('50px')">改变</button>
		
		<script>
			function change(x){
				main.style.width = x ;
			}
		</script>
	</body>
</html>